package com.zhiyou100.action02;

import com.sun.org.apache.regexp.internal.RE;
import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.mvc.Controller;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * @author yang
 * @className Demo02
 * @packageName com.zhiyou100.action01
 * @Description TODO 测试
 * @date 2020-08-21 09:51
 */
public class Demo03 implements Controller {
    @Override
    public ModelAndView handleRequest(HttpServletRequest request, HttpServletResponse response) throws Exception {
        final ModelAndView view = new ModelAndView();

        System.out.println("action d3 执行了！！！");

        final Object message = request.getAttribute("message");
        response.setCharacterEncoding("utf-8");
        response.setContentType("test/html;charset=urf-8");

        response.getWriter().print(
                "<h1>" +
                        "d3 的响应 " + message + "</h1>"
        );


        return null;
    }
}
